public class Main extends Liczba
{
	public static void main(String args[])
	{
		Liczba l;
		int a = 0;
		for(int k=0; k<args.length; k=k+2)
		{
			if((args[k+1].equals("10")) == true)
			{
				try
				{
					a = Integer.parseInt(args[k]);
					l = new Liczba(a);
					try
					{
						for(int b = 2;b<=16;b++)
						{
							System.out.println(args[k] + " = " + l.zapis(b) + " w systemie " + b);
						}
					}
					catch(LiczbaException ex)
					{
						System.out.println(ex.getMessage());
					}
				}
				catch(NumberFormatException ex)
				{
					System.out.println(args[k] + " Niepoprawna liczba ");
				}
			}
			else
			{
				a = Integer.parseInt(args[k+1]);
				try
				{
					l = new Liczba(args[k],a);
					for(int b = 2;b <=16 ;b++)
					{
						System.out.println(args[k] + " = " + l.zapis(b) + " w systemie " + b);
					}
				}
				catch(LiczbaException ex)
				{
					System.out.println(args[k] + ex.getMessage());
				}
			}
			System.out.println("");
		}
	}
}